<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>js调试</title>
		<script>
			var arr=new Array("America","Greece","Britain","Canda","China","Egypt");
			var count=0;
			console.log("开始统计字符的个数：");
			for(var a in arr){
				var index1=arr[a].indexOf("a");
				var index2=arr[a].indexOf("A");
				if(index1!=-1||index2!=-1){
					count++;
				}
			}
			document.write("共有"+count+"个字符中出现a或A")
		</script>


	</head>
	<body>
	</body>
</html>
